package cn.net.msg.cxf.webservice.impl;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;
import javax.jws.WebService;
import javax.jws.soap.SOAPBinding;
import javax.jws.soap.SOAPBinding.Style;

import cn.net.msg.cxf.webservice.IAnnounceWebService;
import cn.net.msg.model.PageView;
import cn.net.msg.model.TbAnnounce;
import cn.net.msg.service.TbAnnounceService;
import cn.net.msg.service.base.Order;

/**
 * <p>
 * FileName: AnnounceWebServiceImpl.java
 * </p>
 * <p>
 * Description: Announce的cxf服务实现类
 * <p>
 * Copyright: surepassserver(c) 2012
 * </p>
 * <p>
 * @author Vic Su
 * </p>
 * <p>
 * @content andyliu900@gmail.com
 * </p>
 * <p>
 * @version 1.0
 * </p>
 * <p>
 * CreatDate: 2013-1-31 下午11:54:16
 * </p>
 * <p>
 * Modification History
 */

@WebService
@SOAPBinding(style = Style.RPC)
@SuppressWarnings("deprecation")
public class AnnounceWebServiceImpl implements IAnnounceWebService {

    private static final long serialVersionUID = -7574227471454771234L;

    @Resource(name="tbAnnounceService")
    TbAnnounceService service;
    
    @Override
    public List<TbAnnounce> getAnnounceForList(int maxresult, int currentpage) {
        // TODO Auto-generated method stub
        List<TbAnnounce> list = new ArrayList<TbAnnounce>();
        
        //这种查询语句用到了limit关键字    详情查看：http://www.daydaydata.com/help/sql/advance/limit.html?1354206187
        PageView<TbAnnounce> pageView = new PageView<TbAnnounce>(maxresult, currentpage);
        list = service.getExamsPapersForList(pageView.getFirstResult(), pageView.getMaxresult(), Order.DESC, "announceCreattime");
        return list;
    }

}
